package cc.rengu.redp.bizimpl.upmp.dao;

import cc.rengu.redp.bizimpl.upmp.domain.UpmpMenu;
import cc.rengu.redp.bizimpl.upmp.vo.UpmpMenuVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author System
 */
public interface UpmpMenuMapper extends BaseMapper<UpmpMenu> {


    List<UpmpMenu> findUserPermissions(String userId);

    List<UpmpMenu> findUserMenus(String userId);

    /**
     * 查找当前菜单/按钮关联的用户 ID
     *
     * @param menuId menuId
     * @return 用户 ID集合
     */
    List<String> findUserIdsByMenuId(String menuId);

    List<UpmpMenu> findMenusByPerms(@Param("perms") String perms);

    String findMenuUrl(@Param("menuName") String menuName);


    IPage<UpmpMenu> findPermsPageList(Page page, @Param("upmpMenuVO") UpmpMenuVO upmpMenuVO);

    IPage<UpmpMenu> permsPrivilegePageList(Page page, @Param("upmpMenuVO") UpmpMenuVO upmpMenuVO);

}
